#pragma once
#include "logic.h"

namespace KeyAss 
{
#define VK_SEMCOLON 0xBA

	class LOGIC_API value
	{
		enum CTRL
		{
			ALL = 0,
			SPACE = 1,
			RETURN = 2,
		};
		friend class Config;
		std::string _line;
		mutable std::string _lineFull;
		mutable int _curpos;
		mutable bool _append;
		enum CTRL _ctrl;
		void SetLine(const std::string& str);
		void SetCursor() const;
		void SetAppend() const;
		std::string ParseKey(const std::string&);
	public:
		const std::string& GetLine() const;
		int GetCursor() const{return _curpos;}
		bool IsAppend() const{return _append;}
		bool IsCtrlKey(DWORD vk) const;
	};

	extern LOGIC_API value valEmpty;
	extern LOGIC_API std::string empty;

	class LOGIC_API Config
	{
		Config(void);
	public:
		static Config& get();
		void Load();
		const value& GetFull(const std::string&);
	};

}